﻿@model IEnumerable<Southern.Models.Southern.Partials.SysUser>
@{
    ViewBag.Title = "User management";
    Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}
<h2>
    User management</h2>
<p class="user-create-new">
    @Html.ActionLink("Create New", "Create",null, new { @class = "s-button" })
</p>
<table border="0" cellpadding="0" cellspacing="0" class="table-user-info">
    <thead>
        <tr>
            <th class="table-header-check">
                <a id="toggle-all"></a>
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                Username
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                DisplayName
            </th>
            <th class="table-header-repeat line-left">
                Email
            </th>
            <th class="table-header-repeat line-left">
                Mobile
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                Address
            </th>
            <th class="table-header-repeat line-left">
                CreatedDate
            </th>
            <th class="table-header-repeat line-left minwidth-1">
                Status
            </th>
            <th class="table-header-options line-left">
                Actions
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr class="alternate-row">
                <td>
                    <input type="checkbox" />
                </td>
                <td class="user-name">
                    @Html.DisplayFor(modelItem => item.Username)
                </td>
                <td class="display-name">
                    @Html.DisplayFor(modelItem => item.DisplayName)
                </td>
                <td class="email">
                    @Html.DisplayFor(modelItem => item.Email)
                </td>
                <td class="mobile">
                    @Html.DisplayFor(modelItem => item.Mobile)
                </td>
                <td class="address">
                    @Html.DisplayFor(modelItem => item.Address)
                </td>
                <td class="create-date">
                    @Html.DisplayFor(modelItem => item.CreatedDate)
                </td>
                <td class="status">
                    @if (item.Status == Convert.ToInt32(Southern.Models.Southern.Partials.StatusUser.Active))
                    {
                        @: @Southern.Common.StringDefine.Active
                    }
                    else
                    {
                        @: @Southern.Common.StringDefine.Inactive
                    }
                </td>
                <td class="actions">
                    @Html.ActionLink(" ", "Edit", new { id = item.UserId }, new { @class = "icon-5 info-tooltip",@title="Edit" })
                    @Html.ActionLink(" ", "Details", new { id = item.UserId }, new { @class = "icon-3 info-tooltip",@title="Details" })
                    @Html.ActionLink(" ", "Delete", new { id = item.UserId }, new { @class = "icon-2 info-tooltip",@title="Delete" })
                </td>
            </tr>           
        }
    </tbody>
</table>
